class Image < ActiveRecord::Base
  belongs_to :post
  belongs_to  :user
  validates_presence_of :file
   def image_file=(input_data)
    if !input_data.blank?
      self.file_name = input_data.original_filename
      self.content_type = input_data.content_type.chomp
      self.file = input_data.read
     end
  end

end
